Deploy the App
- open up the terminal window and type
./mvnw clean package(recall: the Spring Boot project comes with a Maven wrappermvnwin thephotoz-clone/folder)- make sure that you have set up your
JAVA_HOMEenvironment variable to the exact same java version that you are building your project with, otherwise you might run into problemsJAVA_HOMEsetup in linux- this is not necessary, in Ubuntu 20.04
./mvnw clean packagewill build successfully without setting theJAVA_HOMEvariable
- this is not necessary, in Ubuntu 20.04
- make sure that you have set up your
tip
If you are using IntelliJ you could just click on "Maven" (right side of IntelliJ) → photoz-clone → Lifecycle → package (double click).
- then, after the build succeeds, inside the
target/folder (Maven'sbuild/folder) you will have a.jarfile (which has a file size of a couple of MB) - now, you can simply take this
.jarfile, put it on a server, on an arbitrary machine or anywhere you want to and simply run it withjava -jar ./photoz-clone-0.0.1-SNAPSHOT.jar- that is deployment